    /**
     * Created by IntelliJ IDEA.
     * User: Taras_Brzezinsky
     * Date: 8/7/11
     * Time: 2:21 PM
     * To change this template use File | Settings | File Templates.
     */

    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.io.FileReader;
    import java.util.*;
    import java.io.IOException;

    public class Ctulhu extends Thread {


        public Ctulhu() {
            this.input = new BufferedReader(new InputStreamReader(System.in));
            this.output = new PrintWriter(System.out);
            this.setPriority(Thread.MAX_PRIORITY);
        }

        static class Graph {
            List<Integer> g[];
            int n;
            int cycle[];
            int parent[];
            int[] used;
            int end, st;
            List<Integer> cycleVertex = new ArrayList<Integer>();

            public Graph(int n) {
                this.n = n;
                this.g = new ArrayList[n];
                for (int i = 0; i < n; ++i) {
                    g[i] = new ArrayList<Integer>();
                }
                this.parent = new int[n];
                this.cycle = new int[n];
                used = new int [n];
            }

            public void addEdge(int u, int v) {
                g[v].add(u);
                g[u].add(v);
            }

            public boolean dfs(int v, int root) {
                if (used[v] != -1) {
                    int where = Collections.binarySearch(cycleVertex, used[v]);
                    if (where >= 0 && cycleVertex.get(where) != root) {
                        return false;
                    } else {
                        return true;
                    }

                }
                used[v] = root;
                boolean ok = true;
                for (int current : g[v]) {
                    if (Collections.binarySearch(cycleVertex, current) < 0)
                        ok &= dfs(current, root);
                }
                return ok;

            }

            public boolean isCyclic() {
                st = -1;
                for (int i = 0; i < n; ++i) {
                    if (findCycle(i)) {
                        break;
                    }
                }
                if (st != -1) {

                    cycleVertex.add(st);
                    for (int current = end; current != st; current = parent[current]) {
                        cycleVertex.add(current);
                    }
                    Collections.sort(cycleVertex);
                }
                Arrays.fill(used, -1);
                return st != -1;

            }

            boolean findCycle(int v) {
                cycle[v] = 1;
                for (int i = 0; i < g[v].size(); ++i) {
                    int to = g[v].get(i);
                    if (parent[v] == to) {
                        continue;
                    }
                    if (cycle[to] == 0) {
                        parent[to] = v;
                        if (findCycle(to)) return true;
                    } else if (cycle[to] == 1) {
                        end = v;
                        st = to;
                        return true;
                    }
                }
                cycle[v] = 2;
                return false;
            }
        }


        public void run() {
            try {
                int n = nextInt(), m = nextInt();
                Graph g = new Graph(n);
                for (int i = 0; i < m; ++i) {
                    g.addEdge(nextInt() - 1, nextInt() - 1);
                }
                boolean ok = true;
                if (g.isCyclic()) {
                    for (int current : g.cycleVertex) {
                        ok &= g.dfs(current, current);
                    }
                    for (int current : g.used) {
                        ok &= current != -1;
                    }
                } else {
                    ok = false;
                }
                output.println(ok ? "FHTAGN!" : "NO");
                output.flush();
                output.close();

            } catch (Throwable e) {
                System.err.println(e.getMessage());
                System.err.println(Arrays.deepToString(e.getStackTrace()));
            }
        }


        public static void main(String[] args) {
            new Ctulhu().start();
        }

        private String nextToken() throws IOException {
            while (tokens == null || !tokens.hasMoreTokens()) {
                tokens = new StringTokenizer(input.readLine());
            }
            return tokens.nextToken();
        }

        private int nextInt() throws IOException {
            return Integer.parseInt(nextToken());
        }

        private double nextDouble() throws IOException {
            return Double.parseDouble(nextToken());
        }

        private long nextLong() throws IOException {
            return Long.parseLong(nextToken());
        }


        private BufferedReader input;
        private PrintWriter output;
        private StringTokenizer tokens = null;
    }
